Skip to content

Add support for execution sharding #2600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 16, 2025
Merged

Add support for execution sharding #2600

merged 8 commits into from
Aug 16, 2025

Conversation

agologan
Copy link
Contributor

@agologan agologan commented Jul 27, 2025

🤔 What's changed?

⚡️ What's your motivation?

Closes #2303

🏷️ What kind of change is this?

  • 📖 Documentation (improvements without changing code)
  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

Feature is implemented as plugin on event pickles:filter and will run between filter and order plugins.
As such defined order is not affected by sharding and random order will only shuffle tests in a shard.

Alternatively, a new event pickles:shard could be introduced to be executed after pickles:order which would allow a global random seed. This will require a documentation change to warn users they should use the same seed across shards.

The option was added to ISourcesCoordinates as it acts more like a filtering option for a specific instance rather than how --parallel behaves and the plugin was loaded only for runCucumber.

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@coveralls
Copy link

coveralls commented Jul 27, 2025

Coverage Status

coverage: 97.792% (+0.01%) from 97.78%
when pulling 92ba787 on agologan:main
into cf6ab33 on cucumber:main.

Copy link
Contributor

@davidjgoss davidjgoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for contributing this, it's a great quality PR.

Feature is implemented as plugin on event pickles:filter and will run between filter and order plugins.
As such defined order is not affected by sharding and random order will only shuffle tests in a shard.

Alternatively, a new event pickles:shard could be introduced to be executed after pickles:order which would allow a global random seed. This will require a documentation change to warn users they should use the same seed across shards.

I think what you've done is the best balance - no sense in adding another event just for this.

@davidjgoss davidjgoss merged commit c79fe2d into cucumber:main Aug 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve execution time by executing on multiple machines
3 participants